﻿namespace TfsCloudDeploy.Tasks
{
    public class SimpleHeader
    {

        #region Constructors

        public SimpleHeader()
        {
            PrivateImplementationDetails = new string[0];
        }

        public SimpleHeader(string fileHeaderMvid, string debugDirectoryEntryMvid, string timeDateStamp, string fileVersion, string assemblyVersion, string serializerParentAssemblyId, string serializerVersion)
            :this()
        {
            FileHeaderMvid = fileHeaderMvid;
            DebugDirectoryEntryMvid = debugDirectoryEntryMvid;
            TimeDateStamp = timeDateStamp;
            FileVersion = fileVersion;
            AssemblyVersion = assemblyVersion;
            SerializerParentAssemblyId = serializerParentAssemblyId;
            SerializerVersion = serializerVersion;
        }

        #endregion

        #region Properties

        public string FileHeaderMvid { get; set; }

        public string DebugDirectoryEntryMvid { get; set; }

        public string TimeDateStamp { get; set; }

        public string FileVersion { get; set; }

        public string AssemblyVersion { get; set; }

        public string SerializerParentAssemblyId { get; set; }

        public string SerializerVersion { get; set; }

        public string PdbPath { get; set; }

        public string Checksum { get; set; }

        public string ProductVersion { get; set; }

        public string[] PrivateImplementationDetails { get; set; }

        #endregion

        #region Overrides

        public override string ToString()
        {
            return string.Format("Timestamp: {0}, MVID1: {1}, MVID2: {2}, Ver: {3}, AsmVer: {4}, ParentAsmId: {5}, SerializerVer: {6}, PdbPath: {7}, Checksum: {8}, ProductVersion: {9}.",
                TimeDateStamp ?? "-",
                FileHeaderMvid ?? "-",
                DebugDirectoryEntryMvid ?? "-",
                FileVersion ?? "-",
                AssemblyVersion ?? "-",
                SerializerParentAssemblyId ?? "-",
                SerializerVersion ?? "-",
                PdbPath ?? "-",
                Checksum ?? "-",
                ProductVersion ?? "-");
        }

        #endregion
    }
}
